<template>
  <div>
    <el-timeline v-if="formData.length > 0">
      <el-timeline-item v-for="(x, index) in formData" :key="index" :timestamp="x.opTime" placement="top">
        {{ x.opDesc }}
      </el-timeline-item>
    </el-timeline>
    <div v-if="formData.length == 0" style="text-align: center;">暂无信息</div>
    <div
      :style="{
        position: 'absolute',
        left: 0,
        bottom: 0,
        right: 0,
        zIndex: 9,
        borderTop: '1px solid #e9e9e9',
        padding: '10px 20px',
        background: '#fff',
        textAlign: 'center'
      }"
    >
      <el-button @click="closeDrawer(1)">关 闭</el-button>
    </div>
  </div>
</template>
<script>
import { dictionary } from '@/utils/dictMixin';
import { billTrackEMS } from '@/api/dealerFinance/InvoiceManage/InvoiceMailQuery';

export default {
  mixins: [dictionary],
  props: ['rowData'],
  data() {
    return {
      formData: []
    };
  },
  created() {
    this.getDetailInfo();
  },
  methods: {
    async getDetailInfo() {
      const res = await billTrackEMS(this.rowData.courierNo);
      if (res.resultCode == 200) {
        this.formData = res.data;
      }
    },
    selectChangeHandle(rows) {
      this.tableData = JSON.parse(JSON.stringify(rows));
    },

    closeDrawer(type) {
      if (type == 1) {
        return this.$emit('close', false);
      }
    }
  }
};
</script>
